﻿@{
    ViewBag.Title = "List";
    Layout = "~/Views/Shared/_JuiLayout.cshtml";

    string pid = MyRequest.GetQueryString("pid");
    string pidName = "根目录";
    if (pid != "0")
    {
        pidName = selectControlBLL.getNameById("id", pid, "Sys_IBDD", "Name");
    }
    
    string hostId = MyRequest.GetQueryString("hostId");
    string addurl = "/SysMenu/Add?menu=SysIBDDs&name=AddIBDD&hostId="+hostId+"&pid="+pid;
    string editurl = "/SysMenu/Edit/{id}?menu=SysIBDDs&name=Edit&tname=" + DencryptHelper.Encrypt("Sys_IBDD");
    string className = selectControlBLL.getNameById("id", hostId, "Sys_IBClasses", "Name");
    className = className.Length >= 15 ? className.Substring(0, 15) : className;

    string tname = "Sys_IBDD";
    string url = "/SysMenu/SysIBDDs/List";
}
@section header {}
<div id="layout" class="noNavTab">
    <div id="navTab">
        <h2 class="contentTitle">
            数据字典项管理</h2>
        <div class="pageHeader">
            <div class="searchBar">
                <table class="searchContent">
                    <tbody>
                        <tr>
                            <th>
                                所属上级:
                            </th>
                            <td>
                                @pidName
                            </td>
                            <th>
                                所属类别：
                            </th>
                            <td>
                                @className
                            </td>
                            <th>
                                名称：
                            </th>
                            <td>
                                @Html.TextBox("txt_Name", "")
                            </td>
                            <th>
                                状态：
                            </th>
                            <td>
                                @{Html.RenderPartial("~/Views/Shared/ForStates.cshtml");}
                            </td>
                        </tr>
                    </tbody>
                </table>
                <div class="subBar">
                    <ul>
                        <li>
                            <div class="buttonActive">
                                <div class="buttonContent">
                                    <button onclick="loadList(@hostId)">
                                        查询</button>
                                </div>
                            </div>
                        </li>
                    </ul>
                </div>
            </div>
        </div>
        <div class="pageContent">
            <div class="panelBar">
                <ul class="toolBar">
                    <li><a class='add' href='@addurl'><span>新增</span></a></li>

                    <li><a class="edit" href='@editurl' target="editblank" rel="ids">
                        <span>修改</span></a> </li>
                    <li>@Html.Raw(JUIResult.ReturnOpen(tname, url, "1"))</li>
                    <li>@Html.Raw(JUIResult.ReturnDel(tname, url, "1"))</li>
                    <li class="line">line</li>
                </ul>
            </div>
            <div id="listDt" class="pageContent">
            </div>
        </div>

    </div>
</div>

<link href="../../content/jui-normal.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="/Scripts/pager.js"></script>
<script language="javascript" type="text/javascript">
    var con = "SysMenu", node1 = "SysIBDDs", tname = '@DencryptHelper.Encrypt("Sys_IBDD")', vname = '@DencryptHelper.Encrypt("Sys_IBClasses")';
    $(function () {
        
        loadList('@MyRequest.GetQueryString("hostId")');
    });
    function loadList(i) {
        var htmlname = "listDt";
        var pars = i + "," + '@MyRequest.GetQueryString("pid")' + "," + $('#txt_Name').val();
        pars = encodeURI(pars);
        var name = "0_ClassId__0,0_PId__0,0_name__3";
        var tName = '@DencryptHelper.Encrypt("Sys_IBDD")';
        var control = "SysMenu/SysIBDDs/ListControl";
        var datebase = "1";
        var states = $('#states').val();
        list(htmlname, pars, name, tName, control, datebase, states);
    }

</script>
